<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>OA模拟与实现</title>
    <link rel="stylesheet" th:href="@{/bootstrap/bootstrap-3.3.7-dist/css/bootstrap.min.css}"></link>
    <link rel="stylesheet" th:href="@{/css/authoruty.css}"></link>
    <link rel="stylesheet" th:href="@{/css/file.css}"></link>
    <script th:src="@{/js/jquery-3.2.1.min.js}"></script>

    
<style>
</style>
</head>
<body>
    <div class="container-fluid">
        <ol class="breadcrumb nav-top">
            <li><a th:href="@{~/router/index.html}" target="main">首页</a></li>
            <li class="active">修改部门</li>
        </ol>
        <div class="panel panel-info">
            <div class="panel-heading">修改部门</div>
            <div class="panel-body">
                <form action="/depart/updateDepart" method="post" class="form-inline align-self-center">
                    <input type="hidden" name="id" th:value="${depart.id}">
                    <div>
                        <label for="sid">编号：</label>
                        <input th:value="${depart.id}" disabled id="sid"/>
                    </div>
                    <div>
                        <label for="sname">名称：</label>
                        <input th:value="${depart.major}" disabled name="sname" id="sname"/>
                    </div>
                    <div>
                        <label for="principle">负责人：</label>
                        <input th:value="${depart.principle}"  name="principle" id="principle"/>
                    </div>
                    <div>
                        <label for="sintime">人数：</label>
                        <input type="date" th:value="${depart.num}" disabled name="sintime" id="sintime"/>
                    </div>
                    <div>
                        <label for="domain">院部：</label>
                        <input th:value="${depart.domain.domainname}" disabled name="doid" id="domain"/>
                    </div>
                    <div>
                        <label for="depart">创建时间：</label>
                        <input  th:value="${depart.dcreatetime}" disabled id="depart"/>
                    </div>
                    <input type="submit" class="btn btn-info" value="修改"/>
                    <a class="btn btn-info" href="/student/student.html">返回</a>
                </form>
            </div>
            
        </div>
        
    </div>
</body>
<script>
    $("#depart").change(function(){
        var departid = $("#depart option:selected").val();
        $.ajax({
            url:"/student/ajax",
            data:{"departid":departid},
            success:function(data){
                $("#people option").remove();
                for (var i=0;i<data.length;i++){
                    if((data[i].oid!=""||data[i].oid!=null)&&(data[i].oname!=""||data[i].oname!=null)){
                        $("#people").append("<option value="+data[i].oid+">"+data[i].oname+"</option>")
                    }
                }

            }
        })
    })
</script>
</html>